<template>
  <div class="hospital-departments">
    <nav-top title="专科列表" :goback="true"></nav-top>
    <header v-show="false">
      <van-field
        class="search"
        v-model="filed"
        clearable
        right-icon="search"
        placeholder="搜索专科"
        @click-right-icon="$toast('question')"
      />
    </header>
    <div class="result-list">
      <ul>
        <li class="list" v-for="(val,key) in productList" :key="key" @click="to(val.id)">
          <div class="img">
            <img :src="domain+'/usr'+val.img_url" alt />
          </div>
          <div class="msg">
            <p class="name">{{val.cat_name}}</p>
            <span class="intro">{{val.intro}}</span>
          </div>
        </li>
      </ul>
    </div>
    <contact-footer v-show="false"></contact-footer>
  </div>
</template>

<script>
import NavTop from "@/components/nav/navBar";
import ContactFooter from "@/components/footer/contactFooter";

import { domain, search } from '@/api'
import axios from 'axios'
export default {
  name: "HospitalDepartments",
  components: {
    NavTop,
    ContactFooter
  },

  data() {
    return {
      listc:100,
      filed: "",
      domain:domain,
      productList: [
        {
          id:"",
          img_url: "/uploads/image/20190124/5c4969eb2bba8.jpg",
          name: "产品名称显示产品名称显示产品名称显示产品",
          intro:
            "产品概述展示产品概述展示产品概述展示产品盖上展示产品概述展示概述展示"
        },
      ]
    };
  },
  created(){
    // http://iuu.pub/api/old/product/list?fid=1&type=7&offset=0&limit=10
    axios.post(domain+"/api/old/product/list?fid="+search("fid")+"&type=7&offset=0&limit="+this.listc)
    .then((res)=>{
      if(res.data.code==1){
        this.productList = res.data.data
      }
    })
    .catch((err)=>{

    })
  },
  methods: {
    to(id){
      window.location.href = '/hongkong/product/detail?id='+id
    },
    selectType(key) {
      this.active = key;
    }
  }
};
</script>

<style lang='scss' scoped>
.hospital-departments {
  .search {
    margin-top: 50px;
    height: 30px;
    padding: 0 23px;
    border-bottom: 1px solid #e6e6e6;
    input {
      line-height: 33px;
      :-ms-input-placeholder {
        font-size: 12px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: rgba(194, 194, 194, 1);
      }
    }
  }
  .search::after {
    border: none;
  }
  .result-list {
    margin-top: 60px;
    .list {
      display: flex;
      margin: 11px auto;
      width: 300px;
      height: 110px;
      border: 3px solid #f8f8f8;
      border-radius: 5px;
      .img {
        margin: 13px 0 17px 13px;
        img {
          width: 83px;
          height: 83px;
        }
      }
      .msg {
        margin: 20px 0 0 8px;
        .name {
          padding-right: 25px;
          margin: 0;
          font-size: 15px;
          font-family: Microsoft YaHei;
          font-weight: bold;
          color: rgba(0, 0, 0, 1);
          display: -webkit-box;
          /*! autoprefixer: off */
          -webkit-box-orient: vertical;
          /*! autoprefixer: on */
          -webkit-line-clamp: 1;
          overflow: hidden;
        }
        .intro {
          margin-top: 8px;
          padding-right: 25px;
          font-size: 11px;
          display: -webkit-box;
          /*! autoprefixer: off */
          -webkit-box-orient: vertical;
          /*! autoprefixer: on */
          -webkit-line-clamp: 3;
          overflow: hidden;
        }
        span {
          font-size: 11px;
          font-family: Microsoft YaHei;
          font-weight: 400;
          color: rgba(102, 102, 102, 1);
        }
      }
    }
  }
}
</style>